<%@ Language=VBScript %>
<%
option explicit

dim sTestSubmitted
dim sTestInfoFromUser
dim nTest
dim nLength
dim nPos
dim nNum
dim sNewStr

sTestSubmitted = Request.Form("strTestSubmitted")
sTestInfoFromUser = Request.Form("sTestInfoFromUser")

if sTestSubmitted = "true" then
	nTest = sTestInfoFromUser
	
	'Response.Write nTest
		
	nLength = Len(nTest)
	
	'Response.Write nLength
		
	nPos = InStr(1, nTest, "" & chr(13) & "")
	
	Response.Write nPos
	
	'nNum = 0
	dim i
	
	Do While nPos <> 0
		nNum = nNum + 1
		sNewStr = Left(nTest, nPos - 1)
		sNewStr = sNewStr & "<br>"
		sNewStr = sNewStr & Right(nTest, nLength - nPos)
		Response.Write sNewStr
		nTest = sNewStr
		nLength = Len(nTest)
		nPos = InStr(1, nTest, "" & chr(13) & "")
	Loop
	
		sTestInfoFromUser = nTest
		
		Response.Write "<br><br>" & Server.HTMLEncode("" & sTestInfoFromUser & "")
		
		Response.Write "<br><br>"
		
		Response.Write sTestInfoFromUser
end if

%>

<script language="vbscript">

sub submitform()
	frmTest.strTestSubmitted.value = "true"
	frmTest.submit
end sub
</script>

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>

<form name=frmTest action="test.asp" method="post">

<textarea cols="35" rows="5" name="sTestInfoFromUser"><%=sTestInfoFromUser%></textarea>

<br><br>

<input type=hidden name="strTestSubmitted">

<input type="button" name="btnSubmit" value="Submit" onclick="SubmitForm()">

</form>
</BODY>
</HTML>
